package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.AlbumStat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AlbumStatMapper extends BaseMapper<AlbumStat> {


    /**
     * 更新专辑播放数
     * @param count
     * @param albumId
     * @param play
     */
    @Update("update album_stat stat set stat_num = stat_num + #{count} where album_id = #{albumId} and stat_type = #{play} and is_deleted = 0")
    void updateAlbumStat(@Param("count") Integer count, @Param("albumId") Long albumId, @Param("play") String play);
}
